# # coding: utf-8
# from sqlalchemy import Column, DateTime, String, Text, text
# from sqlalchemy.dialects.mysql import BIGINT, INTEGER, LONGTEXT, TINYINT
# from sqlalchemy.ext.declarative import declarative_base
#
# Base = declarative_base()
# metadata = Base.metadata
#
#
# class SysBasicFile(Base):
#     __tablename__ = 'sys_basic_file'
#     __table_args__ = {'comment': '文件信息表'}
#
#     id = Column(BIGINT(20), primary_key=True)
#     relative_path = Column(String(255), comment='文件相对路径')
#     name = Column(String(255), comment='文件名')
#     relative_url = Column(String(255), comment='文件相对url')
#     origin_name = Column(String(255), comment='原始文件名')
#     size = Column(BIGINT(20), comment='大小')
#     creator = Column(BIGINT(20), comment='创建者')
#     create_date = Column(DateTime, comment='创建时间')
#     updater = Column(BIGINT(20), comment='更新者')
#     update_date = Column(DateTime, comment='更新时间')
#     deleted = Column(TINYINT(1), server_default=text("'0'"), comment='是否删除， 0->使用，1->删除')
#
#
# class SysBusiDictDatum(Base):
#     __tablename__ = 'sys_busi_dict_data'
#     __table_args__ = {'comment': '业务字典'}
#
#     id = Column(BIGINT(20), primary_key=True, comment='主键')
#     pid = Column(BIGINT(20), comment='业务字典父ID')
#     check_items_value = Column(String(64), comment='父ID')
#     dict_type_id = Column(BIGINT(20), nullable=False, comment='业务字典类型ID')
#     dict_type_value = Column(String(255), nullable=False, comment='业务字典类型值')
#     dict_data_label = Column(String(255), nullable=False, comment='业务字典标签')
#     acronymy = Column(String(50), comment='首字母拼音')
#     wb = Column(String(50), comment='首字母五笔')
#     dict_data_value = Column(String(255), nullable=False, comment='业务字典值')
#     remark = Column(String(255), comment='备注')
#     sort = Column(INTEGER(10), comment='排序')
#
#     examine_type = Column(String(10), comment='CT检查为CT，核磁检查为MR，X光为DX，超声为US，具体以PACS系统中的为准')
#
#
# class SysBusiDictType(Base):
#     __tablename__ = 'sys_busi_dict_type'
#     __table_args__ = {'comment': '业务字典类型'}
#
#     id = Column(BIGINT(20), primary_key=True, comment='主键')
#     busi_type = Column(String(255), nullable=False, comment='业务字典类型 1->仓库  2->药品   3->物质    4->设备    5->门诊    6->队友   7->多级字典')
#     dict_type_label = Column(String(255), nullable=False, comment='业务字典类型标签')
#     dict_type_value = Column(String(255), nullable=False, comment='业务字典类型值')
#     remark = Column(String(255), comment='备注')
#     sort = Column(INTEGER(10), comment='排序')
#     creator = Column(BIGINT(10), comment='创建者')
#     create_date = Column(DateTime, comment='创建时间')
#     updater = Column(BIGINT(20), comment='更新者')
#     update_date = Column(DateTime, comment='更新时间')
#     deleted = Column(TINYINT(1), server_default=text("'0'"), comment='是否删除， 0->使用，1->删除')
#
#
# class SysConfig(Base):
#     __tablename__ = 'sys_config'
#     __table_args__ = {'comment': '系统配置表'}
#
#     config_name = Column(String(50), primary_key=True, comment='配置主键')
#     config_value = Column(String(255), comment='配置值')
#     description = Column(String(255), nullable=False, comment='说明')
#     creator = Column(String(255), comment='创建者')
#     create_date = Column(DateTime, comment='创建时间')
#     updater = Column(String(255), comment='更新者')
#     update_date = Column(DateTime, comment='更新时间')
#     deleted = Column(TINYINT(1), server_default=text("'0'"), comment='是否删除(0:否 1:是)')
#
#
# class SysDept(Base):
#     __tablename__ = 'sys_dept'
#     __table_args__ = {'comment': '部门管理'}
#
#     id = Column(BIGINT(20), primary_key=True, comment='id')
#     pid = Column(BIGINT(20), index=True, comment='上级ID')
#     pids = Column(String(500), comment='所有上级ID，用逗号分开')
#     name = Column(String(50), nullable=False, comment='名称')
#     short_name = Column(String(50), comment='简称')
#     code = Column(String(50), comment='编码')
#     app_code = Column(String(32), comment='所属系统编码')
#     sort = Column(INTEGER(10), index=True, comment='排序')
#     creator = Column(BIGINT(20), comment='创建者')
#     create_date = Column(DateTime, comment='创建时间')
#     updater = Column(BIGINT(20), comment='更新者')
#     update_date = Column(DateTime, comment='更新时间')
#     region_names = Column(String(255), comment='所属区域名称,用逗号隔开')
#     region_ids = Column(String(255), comment='所属区域id,用逗号隔开')
#     deleted = Column(TINYINT(4), server_default=text("'0'"), comment='是否删除，0->未删除，1->已删除')
#
#
# class SysLanguage(Base):
#     __tablename__ = 'sys_language'
#     __table_args__ = {'comment': '国际化'}
#
#     table_name = Column(String(32), primary_key=True, nullable=False, comment='表名')
#     table_id = Column(BIGINT(20), primary_key=True, nullable=False, index=True, comment='表主键')
#     field_name = Column(String(32), primary_key=True, nullable=False, comment='字段名')
#     field_value = Column(String(200), nullable=False, comment='字段值')
#     language = Column(String(10), primary_key=True, nullable=False, comment='语言')
#
#
# class SysLogError(Base):
#     __tablename__ = 'sys_log_error'
#     __table_args__ = {'comment': '异常日志'}
#
#     id = Column(BIGINT(20), primary_key=True, comment='id')
#     request_uri = Column(String(200), comment='请求URI')
#     request_method = Column(String(20), comment='请求方式')
#     request_params = Column(Text, comment='请求参数')
#     user_agent = Column(String(500), comment='用户代理')
#     ip = Column(String(32), comment='操作IP')
#     error_info = Column(LONGTEXT, comment='异常信息')
#     creator = Column(BIGINT(20), comment='创建者')
#     create_date = Column(DateTime, index=True, comment='创建时间')
#
#
# class SysLogLogin(Base):
#     __tablename__ = 'sys_log_login'
#     __table_args__ = {'comment': '登录日志'}
#
#     id = Column(BIGINT(20), primary_key=True, comment='id')
#     operation = Column(TINYINT(3), comment='用户操作   0：用户登录   1：用户退出')
#     status = Column(TINYINT(3), nullable=False, index=True, comment='状态  0：失败    1：成功    2：账号已锁定')
#     user_agent = Column(String(500), comment='用户代理')
#     ip = Column(String(32), comment='操作IP')
#     creator_name = Column(String(50), comment='用户名')
#     creator = Column(BIGINT(20), comment='创建者')
#     create_date = Column(DateTime, index=True, comment='创建时间')
#
#
# class SysLogOperation(Base):
#     __tablename__ = 'sys_log_operation'
#     __table_args__ = {'comment': '操作日志'}
#
#     id = Column(BIGINT(20), primary_key=True, comment='id')
#     operation = Column(String(50), comment='用户操作')
#     request_uri = Column(String(200), comment='请求URI')
#     request_method = Column(String(20), comment='请求方式')
#     request_params = Column(LONGTEXT, comment='请求参数')
#     request_time = Column(INTEGER(10), nullable=False, comment='请求时长(毫秒)')
#     user_agent = Column(String(500), comment='用户代理')
#     ip = Column(String(32), comment='操作IP')
#     status = Column(TINYINT(3), nullable=False, comment='状态  0：失败   1：成功')
#     creator_name = Column(String(50), comment='用户名')
#     creator = Column(BIGINT(20), comment='创建者')
#     create_date = Column(DateTime, index=True, comment='创建时间')
#
#
# class SysMenu(Base):
#     __tablename__ = 'sys_menu'
#     __table_args__ = {'comment': '菜单管理'}
#
#     id = Column(BIGINT(20), primary_key=True, comment='id')
#     pid = Column(BIGINT(20), index=True, comment='上级ID，一级菜单为0')
#     top_menu_id = Column(BIGINT(20), nullable=False, comment='顶级菜单ID')
#     app_code = Column(String(32), comment='所属系统编码')
#     url = Column(String(200), comment='菜单URL')
#     permissions = Column(String(500), comment='授权(多个用逗号分隔，如：sys:user:list,sys:user:save)')
#     type = Column(TINYINT(3), comment='类型   0：菜单   1：按钮')
#     icon = Column(String(50), comment='菜单图标')
#     sort = Column(INTEGER(11), index=True, comment='排序')
#     creator = Column(BIGINT(20), comment='创建者')
#     create_date = Column(DateTime, comment='创建时间')
#     updater = Column(BIGINT(20), comment='更新者')
#     update_date = Column(DateTime, comment='更新时间')
#
#
# class SysMessage(Base):
#     __tablename__ = 'sys_message'
#     __table_args__ = {'comment': '系统消息表'}
#
#     id = Column(BIGINT(20), primary_key=True, comment='主键id')
#     user_id = Column(BIGINT(20), nullable=False, comment='消息接收人')
#     source = Column(String(50), comment='消息来源')
#     content = Column(String(1024), comment='消息内容')
#     read_status = Column(TINYINT(1), server_default=text("'0'"), comment='是否已读(1->是；0->否)')
#     creator = Column(BIGINT(20), comment='创建者')
#     create_date = Column(DateTime, comment='创建时间')
#     updater = Column(BIGINT(20), comment='更新者')
#     update_date = Column(DateTime, comment='更新时间')
#     deleted = Column(TINYINT(1), server_default=text("'0'"), comment='是否删除， 0->使用，1->删除')
#     done = Column(INTEGER(11), comment='是否完成 , 完成状态  0->未完成，1->处理中， 2->已完成')
#     filter_code = Column(String(100), comment='消息过滤标识')
#
#
# class SysMessageType(Base):
#     __tablename__ = 'sys_message_type'
#     __table_args__ = {'comment': '系统消息类型表'}
#
#     id = Column(BIGINT(20), primary_key=True, comment='主键id')
#     type = Column(String(50), nullable=False, comment='消息类型')
#     name = Column(String(255), comment='类型名称')
#     roles = Column(String(1024), comment='消息类型所绑定的角色ids')
#     template = Column(String(1024), comment='消息模板')
#     creator = Column(BIGINT(20), comment='创建者')
#     create_date = Column(DateTime, comment='创建时间')
#     updater = Column(BIGINT(20), comment='更新者')
#     update_date = Column(DateTime, comment='更新时间')
#     deleted = Column(TINYINT(1), server_default=text("'0'"), comment='是否删除， 0->使用，1->删除')
#
#
# class SysRole(Base):
#     __tablename__ = 'sys_role'
#     __table_args__ = {'comment': '角色管理'}
#
#     id = Column(BIGINT(20), primary_key=True, comment='id')
#     name = Column(String(50), comment='角色名称')
#     app_code = Column(String(32), index=True, comment='所属系统编码')
#     remark = Column(String(100), comment='备注')
#     dept_id = Column(BIGINT(20), index=True, comment='部门ID')
#     data_permission_type = Column(String(100), comment='数据权限类型, 数据字典(data_permission_type)')
#     creator = Column(BIGINT(20), comment='创建者')
#     create_date = Column(DateTime, comment='创建时间')
#     updater = Column(BIGINT(20), comment='更新者')
#     update_date = Column(DateTime, comment='更新时间')
#
#
# class SysRoleDataScope(Base):
#     __tablename__ = 'sys_role_data_scope'
#     __table_args__ = {'comment': '角色数据权限'}
#
#     id = Column(BIGINT(20), primary_key=True, comment='id')
#     role_id = Column(BIGINT(20), index=True, comment='角色ID')
#     dept_id = Column(BIGINT(20), comment='部门ID')
#     creator = Column(BIGINT(20), comment='创建者')
#     create_date = Column(DateTime, comment='创建时间')
#
#
# class SysRoleMenu(Base):
#     __tablename__ = 'sys_role_menu'
#     __table_args__ = {'comment': '角色菜单关系'}
#
#     id = Column(BIGINT(20), primary_key=True, comment='id')
#     role_id = Column(BIGINT(20), index=True, comment='角色ID')
#     menu_id = Column(BIGINT(20), index=True, comment='菜单ID')
#     app_code = Column(String(32), index=True, comment='所属系统编码')
#     creator = Column(BIGINT(20), comment='创建者')
#     create_date = Column(DateTime, comment='创建时间')
#
#
# class SysRoleUser(Base):
#     __tablename__ = 'sys_role_user'
#     __table_args__ = {'comment': '角色用户关系'}
#
#     id = Column(BIGINT(20), primary_key=True, comment='id')
#     role_id = Column(BIGINT(20), index=True, comment='角色ID')
#     user_id = Column(BIGINT(20), index=True, comment='用户ID')
#     app_code = Column(String(32), index=True, comment='所属系统编码')
#     creator = Column(BIGINT(20), comment='创建者')
#     create_date = Column(DateTime, comment='创建时间')
#
#
# class SysTopMenu(Base):
#     __tablename__ = 'sys_top_menu'
#     __table_args__ = {'comment': '顶级菜单表'}
#
#     id = Column(BIGINT(20), primary_key=True, comment='主键')
#     code = Column(String(255), comment='顶部菜单编号')
#     name = Column(String(255), comment='顶部菜单名')
#     source = Column(String(255), comment='顶部菜单资源')
#     app_code = Column(String(32), comment='所属系统编码')
#     sort = Column(INTEGER(2), comment='顶部菜单排序')
#     creator = Column(BIGINT(20), comment='创建人')
#     create_dept = Column(BIGINT(64), comment='创建部门')
#     create_date = Column(DateTime, comment='创建时间')
#     updater = Column(BIGINT(20), comment='修改人')
#     update_date = Column(DateTime, comment='修改时间')
#     status = Column(INTEGER(2), comment='状态')
#     deleted = Column(INTEGER(2), comment='是否已删除')
#
#
# class SysUser(Base):
#     __tablename__ = 'sys_user'
#     __table_args__ = {'comment': '系统用户'}
#
#     id = Column(BIGINT(20), primary_key=True, comment='id')
#     username = Column(String(50), nullable=False, index=True, comment='用户名')
#     password = Column(String(100), comment='密码')
#     real_name = Column(String(50), comment='姓名')
#     head_url = Column(String(200), comment='头像')
#     gender = Column(TINYINT(3), comment='性别   0：男   1：女    2：保密')
#     email = Column(String(100), comment='邮箱')
#     mobile = Column(String(100), comment='手机号')
#     sort = Column(TINYINT(2), comment='排序')
#     dept_id = Column(BIGINT(20), comment='部门ID')
#     dept_ids = Column(String(255), comment='多个部门ids，逗号连接')
#     app_codes = Column(String(200), comment='绑定系统编码，多个逗号分隔')
#     role_ids = Column(String(255), comment='多个角色ids，逗号连接')
#     super_admin = Column(TINYINT(3), comment='超级管理员   0：否   1：是')
#     status = Column(TINYINT(4), comment='状态  0：停用   1：正常')
#     creator = Column(BIGINT(20), comment='创建者')
#     create_date = Column(DateTime, index=True, comment='创建时间')
#     updater = Column(BIGINT(20), comment='更新者')
#     update_date = Column(DateTime, comment='更新时间')
#     deleted = Column(TINYINT(1), server_default=text("'0'"), comment='0:使用  1:删除')
#     open_id = Column(String(100), comment='微信openid')
#     login_failed_count = Column(INTEGER(11), server_default=text("'0'"), comment='登录失败次数')
#     login_failed_date = Column(DateTime, comment='最后一次登录失败时间')
#     update_password_date = Column(DateTime, server_default=text("CURRENT_TIMESTAMP"), comment='更新密码时间')
#
#
# class SysUserDept(Base):
#     __tablename__ = 'sys_user_dept'
#
#     id = Column(BIGINT(20), primary_key=True, comment='id')
#     user_id = Column(BIGINT(20), nullable=False, comment='用户id')
#     dept_id = Column(BIGINT(20), nullable=False, comment='部门id')
#     creator = Column(BIGINT(20), comment='创建者')
#     create_date = Column(DateTime, comment='创建时间')
